package com.example.ksnacosconsumer.Controller;

import com.alibaba.fastjson.JSON;
import com.example.ksnacosconsumer.Client.CustomerClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import pojo.Customer;

@RestController
public class CustomerController {

    @Autowired
    private CustomerClient customerClient;

    @RequestMapping(value = "/InsertCustomer")
    public boolean InsertCustomer(Customer customer){
        return customerClient.InsertCustomer(customer);
    }

    @RequestMapping(value = "/DelCustomer")
    public boolean DelCustomer( int id){
        return customerClient.DelCustomer(id);
    }

    @RequestMapping(value = "/UpdateCustomer")
    public boolean UpdateCustomer( Customer customer){
        return customerClient.UpdateCustomer(customer);
    }

    @RequestMapping(value = "/SelCustomer")
    public String SelCustomer(String customerNumber, String customerName,Integer pageno){
        return customerClient.SelCustomer(customerNumber,customerName,pageno);
    }
}
